<form name="frm" action="<?php echo $this->site['base_url']?>admin_questions/save" method="post" enctype="multipart/form-data">
<table class="title" cellspacing="0" cellpadding="0">
  <tr>
    <td class="title_label"><?php echo Kohana::lang('admin_lang.menu_home') ?>&nbsp;>>&nbsp;<?php echo Kohana::lang('questions_lang.tt_page')?></td>
    <td class="title_button">
    <button type="button" name="btn_back" class="button back" onclick="javascript:location.href='<?php echo $this->site['base_url']?>admin_questions/search'">
    <span><?php echo Kohana::lang('admin_lang.btn_back')?></span>
    </button>
    &nbsp;
    <button type="reset" name="btn_reset" class="button reset"/>
    <span><?php echo Kohana::lang('admin_lang.btn_reset')?></span>
    </button>
    &nbsp;
    <button type="submit" name="btn_save" class="button save">
    <span><?php echo Kohana::lang('admin_lang.btn_save')?></span>
    </button>
    </td>
  </tr>
</table>
<table class="form" cellspacing="0" cellpadding="5">
  	<?php for($i=0; $i<count($list_language); $i++){ ?>
    <tr>
    <td width="10%" valign="top" nowrap="nowrap"><?php echo Kohana::lang('questions_lang.lbl_title')?>: <font color="#FF0000">*</font> [<?php echo $list_language[$i]['languages_name']?>]</td>
    <td><div style="float:left;">
        <input type="text" value="<?php if (isset($mr[$i]['questions_title'])) echo $mr[$i]['questions_title']; ?>" id="txt_title<?php echo $list_language[$i]['languages_id']?>" name="txt_title<?php echo $list_language[$i]['languages_id']?>" size="70"/>
       
      </div>
      <div style="float:left;padding-left:10px;"> <img src="<?php echo $this->site['base_url']?>uploads/language/<?php echo $list_language[$i]['languages_image']?>" width="20" id="img_language1" name="img_language1" height="20" /> </div>    </td>
    </tr>
    <?php }?>
	
   <tr>
        <td nowrap="nowrap"><?php echo Kohana::lang('admin_lang.lbl_order')?>:</td>
        <td><input name="txt_sort_order" class="text_number" size="10" value="<?php if (isset($mr[0]['questions_sort_order'])){ echo $mr[0]['questions_sort_order']; } else {echo '0'; }?>" /></td>
  	</tr>
	<tr>
	  	<td><?php echo Kohana::lang('admin_lang.lbl_status')?>:</td>
        <td>
        <select name="sel_status" id="sel_status">
            <option value="1" <?php if(isset($mr[0]['questions_status']) && $mr[0]['questions_status']==1) echo 'selected'?> ><?php echo Kohana::lang('admin_lang.lbl_active')?></option>
			<option value="0"><?php echo Kohana::lang('admin_lang.lbl_inactive')?></option>	
          	
        </select>        </td>
	</tr>
    <tr>
      	<td>&nbsp;</td>
		<td><input name="hd_id" type="hidden" id="hd_id" value="<?php echo isset($mr[0]['questions_id'])?$mr[0]['questions_id']:''?>"/></td>
	</tr>
	<?php if(!empty($mr[0]['questions_id'])){?>
	<tr>
      	<td>Answer</td>
		<td></td>
	</tr>
		<?php for($i=0; $i<count($list_language); $i++){ ?>
    <tr>
    <td width="10%" valign="top" nowrap="nowrap"><?php echo Kohana::lang('questions_lang.lbl_answer')?>: <font color="#FF0000">*</font> [<?php echo $list_language[$i]['languages_name']?>]</td>
    <td><div style="float:left;">
        <input type="text" value="<?php if (isset($mrAnswers[$i]['answers_title'])) echo $mrAnswers[$i]['answers_title']; ?>" id="txt_answers_title<?php echo $list_language[$i]['languages_id']?>" name="txt_answers_title<?php echo $list_language[$i]['languages_id']?>" size="70"/>
       
      </div>
      <div style="float:left;padding-left:10px;"> <img src="<?php echo $this->site['base_url']?>uploads/language/<?php echo $list_language[$i]['languages_image']?>" width="20" id="img_language1" name="img_language1" height="20" /> </div>    </td>
    </tr>
    <?php
		}
	 ?>
	 <tr>
      	<td>True/False</td>
		<td>
		<?php 
		$checked1='';
		$checked0='';
		if(@$mrAnswers[0]['answers_true_falle']==1){
				$checked1 = 'checked="checked"';
		}else
		{
			    $checked0 = 'checked="checked"';
		}
		?>
		<input name="answers_true_falle" type="radio" value="1" <?php echo $checked1;?> />True &nbsp; &nbsp;
		<input name="answers_true_falle" type="radio" value="0" <?php echo $checked0;?> />False
		</td>
	</tr>
	<tr>
      	<td>&nbsp;</td>
		<td><input name="hd_answers_id" type="hidden" value="<?php echo isset($mrAnswers[0]['answers_id'])?$mrAnswers[0]['answers_id']:''?>"/></td>
	</tr>
	<?
	}
	?>
</table>
<table class="list" cellspacing="1" cellpadding="5">
  
  <?php if(!empty($mlistAnswers)){?>
  <?php for($i=0; $i<count($mlistAnswers); $i++){ ?>
  <tr class="row<?php echo $i%2==0?2:''?>">
   <?php $languages = $mlistAnswers[$i]['languages']?>
    <?php for($j=0;$j<count($languages);$j++){?>
    <td style="text-align:left;">
    <a href="<?php echo $this->site['base_url']?>admin_questions/edit/<?php if(isset($mlistAnswers[$i]['answers_id'])) echo $mlistAnswers[$i]['answers_id']?>">	
    <?php echo @$languages[$j]['answers_title']?>
	</a>
    </td>
    <?php }?>
	<td><?php if($mlistAnswers[$i]['answers_true_falle']==1) {echo "True";} else {echo "False";}?></td>
	<td align="center">
      <a href="<?php echo $this->site['base_url']?>admin_questions/edit/<?php echo $mr[0]['questions_id']?>/<?php if(isset($mlistAnswers[$i]['answers_id'])) echo $mlistAnswers[$i]['answers_id']?>">
        <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_edit.png" title="<?php echo Kohana::lang('admin_lang.btn_edit')?>" />
        </a>
      <a href="<?php echo $this->site['base_url']?>admin_questions/delete_answers/<?php echo $mr[0]['questions_id']?>/<?php if(isset($mlistAnswers[$i]['answers_id'])) echo $mlistAnswers[$i]['answers_id']?>" onclick="return confirm('<?php echo Kohana::lang('errormsg_lang.msg_confirm_del')?>')">
        <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_delete.png" title="<?php echo Kohana::lang('admin_lang.btn_delete')?>" />
        </a>
    </td>
</tr>
<?php }
}
?> 
   </table>
</form>
<script language="javascript" src="<?php echo $this->site['base_url']?>/themes/plugins/ckeditor/ckeditor.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $this->site['base_url']?>themes/plugins/tabcontent/tabcontent.css">
<script type="text/javascript" src="<?php echo $this->site['base_url']?>themes/plugins/tabcontent/tabcontent.js"></script>
<script type="text/javascript">
var countries=new ddtabcontent("product_tab")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>
<iframe width=174 height=189 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="<?php echo $this->site['base_url']?>themes/plugins/calendar/ipopeng.htm" scrolling="no" frameborder="0" 
style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
</iframe>